﻿using UnityEngine;
using System.Collections;

public class HUD : MonoBehaviour {
	private GameObject botaoRespawn = null;
	private Vector3 scale;
	private Vector3 scaleDown;
	private Vector3 scaleIni;


	// Use this for initialization
	void Start () {
		botaoRespawn = GameObject.Find("botaoRespawn");
		scaleIni = botaoRespawn.transform.localScale;
		scale.x = botaoRespawn.transform.localScale.x * 1.10f;
		scale.y = botaoRespawn.transform.localScale.y * 1.10f;
		scale.z = scale.x;
		scaleDown.x = botaoRespawn.transform.localScale.x * 0.90f;
		scaleDown.y = botaoRespawn.transform.localScale.y * 0.90f;
		scaleDown.z = scaleDown.x;

	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void OnMouseUpAsButton() {
		if (this.gameObject == botaoRespawn)
		{
			GameObject textObject = (GameObject)Instantiate(Resources.Load("Personagem"));
		}
	}

	void OnMouseDown()
	{
		this.transform.localScale = scaleDown;
	}

	void OnMouseOver() {

		//this.transform.localScale = new Vector3(Mathf.Lerp(scaleIni.x, scale.x, Time.time), Mathf(scaleIni.y,scaleIni.x,Time.time),scale.z);
		//this.transform.localScale = scale;
		
	}

	void OnMouseExit() {
		this.transform.localScale = scaleIni;
	}
}
